
{{!-- message --}}
{{{indent}}}export class {{{message.messageName}}} extends jspb.Message { {{!-- type class start --}}
{{#each message.fields}}{{!-- fields start --}}
    {{~#if this.isMapField~}}{{!-- map spec start --}}
{{{../indent}}}    get{{{this.camelUpperName}}}Map(): jspb.Map<{{{this.mapFieldInfo.keyTypeName}}}, {{{this.mapFieldInfo.valueTypeName}}}>;
{{{../indent}}}    clear{{{this.camelUpperName}}}Map(): void;
    {{~else~}}{{!-- map spec else --}}
        {{~#if this.hasFieldPresence~}}{{!-- hasFieldPresence start --}}
{{{../indent}}}    has{{{formatName this.camelUpperName}}}(): boolean;
            {{#is this.hasClearMethodCreated false}}
{{{../indent}}}    {{printClearIfNotPresent this}}
            {{/is}}
        {{~/if~}}{{!-- hasFieldPresence end --}}
        {{~#if this.isRepeatField~}}{{!-- repeat start --}}
            {{~#is this.hasClearMethodCreated false~}}
{{{../indent}}}    {{printClearIfNotPresent this}}
            {{/is}}
            {{~#is this.type ../BYTES_TYPE~}}
{{{../indent}}}    get{{{this.camelUpperName}}}List(): Array<Uint8Array | string>;
{{{../indent}}}    get{{{this.camelUpperName}}}List_asU8(): Array<Uint8Array>;
{{{../indent}}}    get{{{this.camelUpperName}}}List_asB64(): Array<string>;
{{{../indent}}}    set{{{this.camelUpperName}}}List(value: Array<Uint8Array | string>): {{{../message.messageName}}};
{{{../indent}}}    {{printRepeatedAddMethod this "Uint8Array | string"}}
            {{~else~}}
{{{../indent}}}    get{{{this.camelUpperName}}}List(): Array<{{{this.exportType}}}>;
{{{../indent}}}    set{{{this.camelUpperName}}}List(value: Array<{{{this.exportType}}}>): {{{../message.messageName}}};
{{{../indent}}}    {{printRepeatedAddMethod this this.exportType}}
            {{~/is~}}
        {{~else~}}{{!-- repeat else --}}
            {{~#is this.type ../BYTES_TYPE~}}
{{{../indent}}}    get{{{formatName this.camelUpperName}}}(): Uint8Array | string;
{{{../indent}}}    get{{{this.camelUpperName}}}_asU8(): Uint8Array;
{{{../indent}}}    get{{{this.camelUpperName}}}_asB64(): string;
{{{../indent}}}    set{{{formatName this.camelUpperName}}}(value: Uint8Array | string): {{{../message.messageName}}};
            {{~else~}}
{{{../indent}}}    get{{{formatName this.camelUpperName}}}(): {{{this.exportType}}}{{#if this.canBeUndefined}} | undefined{{/if}};
{{{../indent}}}    set{{{formatName this.camelUpperName}}}(value{{#is this.type ../MESSAGE_TYPE}}?{{/is}}: {{{this.exportType}}}): {{{../message.messageName}}};
            {{~/is~}}
        {{~/if~}}{{!-- repeat end --}}
    {{~/if~}}{{!-- map spec end --}}
{{/each}}{{!-- fields end --}}
{{~#if message.oneofDeclList~}}{{!-- oneofDeclList start --}}
{{#each message.oneofDeclList}}
{{{../indent}}}    get{{oneOfName this}}Case(): {{{../message.messageName}}}.{{oneOfName this}}Case;
{{/each}}
{{~/if~}}{{!-- oneofDeclList end --}}
{{{indent}}}    serializeBinary(): Uint8Array;
{{{indent}}}    toObject(includeInstance?: boolean): {{{message.messageName}}}.{{{objectTypeName}}};
{{{indent}}}    static toObject(includeInstance: boolean, msg: {{{message.messageName}}}): {{{message.messageName}}}.{{{objectTypeName}}};
{{{indent}}}    static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
{{{indent}}}    static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
{{{indent}}}    static serializeBinaryToWriter(message: {{{message.messageName}}}, writer: jspb.BinaryWriter): void;
{{{indent}}}    static deserializeBinary(bytes: Uint8Array): {{{message.messageName}}};
{{{indent}}}    static deserializeBinaryFromReader(message: {{{message.messageName}}}, reader: jspb.BinaryReader): {{{message.messageName}}};
{{{indent}}}{{curlyRight}}{{!-- type class end --}}

{{!-- namespace --}}
{{{indent}}}export namespace {{{message.messageName}}} {
{{{indent}}}    export type {{{objectTypeName}}} = {
{{#each message.fields}}{{!-- fields start --}}
    {{~#if this.isMapField~}}{{!-- map spec start --}}
{{{../indent}}}        {{{this.camelCaseName}}}Map: Array<[{{{this.mapFieldInfo.keyTypeName}}}{{~#is this.mapFieldInfo.keyType ../MESSAGE_TYPE~}}.AsObject{{~/is~}}, {{{this.mapFieldInfo.valueTypeName}}}{{~#is this.mapFieldInfo.valueType ../MESSAGE_TYPE~}}.AsObject{{~/is~}}]>,
    {{~else~}}{{!-- map spec else --}}
        {{~#if this.isRepeatField~}}{{!-- repeat start --}}
            {{~#is this.type ../BYTES_TYPE~}}
{{{../indent}}}        {{{this.camelCaseName}}}List: Array<Uint8Array | string>,
            {{~else~}}
{{{../indent}}}        {{{this.camelCaseName}}}List: Array<{{{this.exportType}}}{{~#is this.type ../MESSAGE_TYPE~}}.AsObject{{~/is~}}>,
            {{~/is~}}
        {{else}}{{!-- repeat else --}}
            {{~#is this.type ../BYTES_TYPE~}}
{{{../indent}}}        {{{this.camelCaseName}}}: Uint8Array | string,
            {{~else~}}
{{{../indent}}}        {{{this.camelCaseName}}}{{~#if this.canBeUndefined~}}?{{~/if~}}: {{{this.fieldObjectType}}},
            {{~/is~}}
        {{~/if~}}{{!-- repeat end --}}
    {{~/if~}}{{!-- map spec end --}}
{{/each}}{{!-- fields end --}}{{{indent}}}    }
{{~#if message.nestedTypes~}}{{!-- nestedTypes start --}}

{{#each message.nestedTypes}}
{{{render 'partial/message' this}}}
{{/each}}
{{~/if~}}{{!-- nestedTypes end --}}
{{~#if message.formattedEnumListStr~}}{{!-- formattedEnumListStr start --}}
{{#each message.formattedEnumListStr}}
{{{render 'partial/enum' this}}}
{{/each}}
{{~/if~}}{{!-- formattedEnumListStr end --}}
{{~#if message.formattedOneofListStr~}}{{!-- formattedOneofListStr start --}}
{{#each message.formattedOneofListStr}}
{{{render 'partial/oneof' this}}}
{{/each}}
{{~/if~}}{{!-- formattedOneofListStr end --}}
{{~#if message.formattedExtListStr~}}{{!-- formattedExtListStr start --}}
{{#each message.formattedExtListStr}}
{{{render 'partial/extension' this}}}
{{/each}}
{{~/if~}}{{!-- formattedExtListStr end --}}
{{{indent}}}{{curlyRight}}